//     https://www.nowcoder.com/questionTerminal/248ccf8b479c49a98790db17251e39bb



#include <iostream>
#include <algorithm>
using namespace std;

const int N = 300000003;
int a[N];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < 3 * n; i++)
        cin >> a[i];
    sort(a, a + 3 * n);
    long long ans = 0;
    for (int i = 3 * n - 2; i >= n; i -= 2)
        ans += a[i];
    cout << ans;
    return 0;
}